import request from '@/utils/request.js'

/**
 * 频道相关接口
 * 
 */

// 获取所有频道

const  getAllChannels = ()  =>  {
    return request.get('/v1_0/channels')
}

// 设置频道

const setUserChannels = (channels) => {
    // return request.patch('/v1_0/user/channels', { channels:channels })
    return request({
        url:'/v1_0/user/channels',
        method: 'PATCH',
        data:{
            channels:channels
        }
    })
}

// 删除用户指定频道

const deleteUserChannels = (channelId) =>{
    return request({
        url:`/v1_0/user/channels/${channelId}`,
        method: 'DELETE'
    })
}

export{
    getAllChannels,
    setUserChannels,
    deleteUserChannels
}